<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>ajax</title>
<style type="text/css"></style>
</head>
<body>
<p><input id="text" value="" type="text" onkeyup="getCustomerInfo()" /></p>
<p id="content"></p>
<script type="text/javascript">
/*function newXMLHTTPRequest(){
	var xmlreq=false;
	if(window.XMLHttpRequest){
		xmlreq=new XMLHttpRequest();
	}else if (window.ActiveXObject){
		try{
			xmlreq=new ActiveXObject("Msxm12.XMLHTTP");
		}catch(e1){
			try{
				xmlreq=new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch(e2){}
		}
	};
	return xmlreq;
}*/







var request=false;
try{
	request=new XMLHttpRequest();
}
catch(trymicrosoft){
	try{
		request=new ActiveXObject("Msxm12.XMLHTTP");
	}
	catch(othermicrosoft){
		try{
			request=new ActiveXObject("Microsoft.XMLHTTP");
		}
		catch(failed){
			request=flase;
		}
	}
}
if (!request)
alert("Error initializing XMLHttpRequest !")
function getCustomerInfo(){	
	var va=document.getElementById("text").value;
	var url="/ajax_post.php";
	var data="phone="+va;
	request.open("post",url,true);
	request.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
	request.onreadystatechange=updatePage;
	request.send(data);	
}
function updatePage(){
	if(request.readyState==4)
		if(request.status==200)
		//var response=request.responseText.split("|");		
		document.getElementById("content").innerHTML=request.responseText;	
		
}





</script>
</body>
</html>
